import 'package:json_annotation/json_annotation.dart';

part 'review.g.dart';

@JsonSerializable()
class VisitorReviewModel {
  /// 头像
  String avatar;

  /// 时间
  String date;

  /// 昵称
  String nickname;

  /// 来自
  String from;

  /// 点赞
  int like;

  /// 介绍
  String introduce;

  /// 相片
  List<String> photos;

  VisitorReviewModel(
      {required this.avatar,
      required this.date,
      required this.nickname,
      required this.from,
      this.like = 0,
      required this.introduce,
      this.photos = const []});

  factory VisitorReviewModel.fromJson(Map<String, dynamic> json) => _$VisitorReviewModelFromJson(json);

  Map<String, dynamic> toJson() => _$VisitorReviewModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}
